﻿#pragma once 

#include <iostream>
#include "tensorflow/lite/c/c_api.h"
#include "humanseg_base.h"


using namespace std;

class MBV3HumanSegTFLite: public HumanSegBase
{
public:
	MBV3HumanSegTFLite(const char *model_name, int model_width, int model_height, int is_video, int enable_debug);
	~MBV3HumanSegTFLite();
public:
	int detect_rgb24_do(unsigned char *buf_rgb, int src_pitch, unsigned char *alpha, int alpha_pitch);

private:
    TfLiteTensor * getOutputTensorByName(TfLiteInterpreter * interpreter, const char * name);
    TfLiteTensor * getInputTensorByName(TfLiteInterpreter * interpreter, const char * name);
    void initModel(string path );

private:
    TfLiteModel         *model_;
    TfLiteTensor        *input_tf_;
    TfLiteTensor        *output_tf_;
    TfLiteInterpreter   *interpreter_;
    float *src_data_net_in_;
    float *data_net_out_;
};